package com.zhuge_new.Adapter;

import android.content.Context;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.zhuge_new.R;
import com.zhuge_new.bean.CardListBean;
import com.zhuge_new.bean.ExamBean;
import com.zhuge_new.bean.GatheringBean;
import com.zhuge_new.share.BaseHttp;
import com.zhuge_new.untils.DataUtilS;
import com.zhuge_new.untils.GlideUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2018/11/13.
 */

public class GatherDialogAdapter extends BaseQuickAdapter<ExamBean.CreditcardsBean,BaseViewHolder>{


    private Context context;
    private List<ExamBean.CreditcardsBean> data=new ArrayList<>();
    private String check;
    public GatherDialogAdapter(Context context, @Nullable List<ExamBean.CreditcardsBean> data,String check) {
        super(R.layout.item_gatherdialog,data );
        this.context=context;
        this.data=data;
        this.check=check;

    }


    @Override
    protected void convert(BaseViewHolder helper, ExamBean.CreditcardsBean item) {
        ImageView gatherdialog_logo=helper.getView(R.id.gatherdialog_logo);
        GlideUtils.loadClippingImageSize(context, BaseHttp.baseImg1+item.getLogoUrl(),100,100,gatherdialog_logo);
        helper.setText(R.id.gatherdialog_bank,item.getBank()+" 尾号("+item.getCreditcardSuf()+")");
        ImageView gatherdialog_state=helper.getView(R.id.gatherdialog_state);
        if (item.getCreditcardId().equals(check)){
            gatherdialog_state.setVisibility(View.VISIBLE);
        }
    }
}
